import Vue from 'vue'
//对应你要跳转的组件
import Router from 'vue-router'
import Login from '@/views/login/login.vue'
// import register from '@/views/login/register.vue'
import Menu from '@/views/menu/index.vue'
import Test from '@/components/test.vue'
import Test02 from '@/components/test02.vue'
import Index from '@/views/index/index.vue'
import articleAdmin from '@/views/blogAdmin/articleAdmin/articleAdmin.vue'
import addArticle from '@/views/blogAdmin/articleAdmin/addArticle.vue'
import updateAtricle from '@/views/blogAdmin/articleAdmin/updateAtricle.vue'
import previewArticle from '@/views/blogAdmin/articleAdmin/previewArticle.vue'
import oneArticle from '@/views/blogAdmin/articleAdmin/oneArticle.vue'
import tagAdmin from '@/views/blogAdmin/tagAdmin/tagAdmin.vue'
import tagTypeAdmin from '@/views/blogAdmin/tagAdmin/tagTypeAdmin.vue'
import node from '@/views/blogAdmin/nodeAdmin/node.vue'
import nodeList from '@/views/blogAdmin/nodeAdmin/nodeList.vue'
import codeAdmin from '@/views/blogAdmin/codeAdmin/codeAdmin.vue'
import projectAdmin from '@/views/blogAdmin/projectAdmin/projectAdmin.vue'
import aboutAdmin from '@/views/aboutAdmin/aboutAdmin.vue'
import userAdmin from '@/views/systemAdmin/userAdmin.vue'
import roleAdmin from '@/views/systemAdmin/roleAdmin.vue'
import menuAdmin from '@/views/systemAdmin/menuAdmin.vue'
import baseMess from '@/views/myMess/baseMess.vue'
import community from '@/views/community/community.vue'
// import communityAdmin from '@/views/community/communityAdmin.vue'
import publicBaseMess from '@/views/myMess/publicBaseMess.vue'
import staticAll from '@/components/test.vue'


Vue.use(Router)
const router = new Router({ 
    routes: [
        {
            path:'/login',
            name:'login',
            component:Login
        },
        // {
        //     path:'/register',
        //     name:'register',
        //     component:register
        // },
        {
            path:'/',
            name:'menu',
            meta: { title: '首页' },
            component:Menu,
            children:[
                {
                    path:'index',
                    name:'index',
                    meta: { title: '首页' },
                    component:Index,
                },
                {
                    path:'articleAdmin',
                    name:'articleAdmin',
                    meta: { title: '博客/博客文章' },
                    component:articleAdmin
                },
                {
                    path:'addArticle',
                    name:'addArticle',
                    meta: { title: '博客/添加文章' },
                    component:addArticle,
                    meta:{
                        keepAlive: true,
                    }
                },
                {
                    path:'previewArticle',
                    name:'previewArticle',
                    meta: { title: '博客/预览文章' },
                    component:previewArticle
                },
                {
                    path:'oneArticle',
                    name:'oneArticle',
                    meta: { title: '博客/文章' },
                    component:oneArticle
                },
                {
                    path:'updateAtricle',
                    name:'updateAtricle',
                    meta: { title: '博客/修改文章' },
                    component:updateAtricle
                },
                {
                    path:'node',
                    name:'node',
                    meta: { title: '博客/笔记' },
                    component:node
                },
                {
                    path:'nodeList',
                    name:'nodeList',
                    meta: { title: '博客/笔记列表' },
                    component:nodeList
                },
                {
                    path:'codeAdmin',
                    name:'codeAdmin',
                    meta: { title: '博客/笔记管理' },
                    component:codeAdmin
                },
                {
                    path:'projectAdmin',
                    name:'projectAdmin',
                    meta: { title: '博客/项目管理' },
                    component:projectAdmin
                },
                {
                    path:'/aboutAdmin',
                    name:'aboutAdmin',
                    meta: { title: '关于围群管理' },
                    component:aboutAdmin
                },
                {
                    path:'/userAdmin',
                    name:'userAdmin',
                    meta: { title: '系统管理/用户管理' },
                    component:userAdmin
                },
                {
                    path:'/roleAdmin',
                    name:'roleAdmin',
                    meta: { title: '系统管理/角色管理' },
                    component:roleAdmin
                },
                {
                    path:'/menuAdmin',
                    name:'menuAdmin',
                    meta: { title: '系统管理/菜单管理' },
                    component:menuAdmin
                },
                {
                    path:'/baseMess',
                    name:'baseMess',
                    meta: { title: '基本信息' },
                    component:baseMess
                },
                {
                    path:'/community',
                    name:'community',
                    meta: { title: '围群社区' },
                    component:community
                },
                // {
                //     path:'/communityAdmin',
                //     name:'communityAdmin',
                //     component:communityAdmin
                // },
                {
                    path:'/publicBaseMess',
                    name:'publicBaseMess',
                    meta: { title: '系统管理/用户公共信息' },
                    component:publicBaseMess
                },
                {
                    path:'/tagAdmin',
                    name:'tagAdmin',
                    meta: { title: '博客/标签管理' },
                    component:tagAdmin
                },
                {
                    path:'/tagTypeAdmin',
                    name:'tagTypeAdmin',
                    meta: { title: '博客/标签类型管理' },
                    component:tagTypeAdmin
                },
               
            ]
        },

        {
            path:'/test',
            name:'test',
            component:Test
        },
        {
            path:'/test02',
            name:'test02',
            component:Test02
        },
        
    ]
    
})

const VueRouterPush = Router.prototype.push
Router.prototype.push = function push(to) {
    return VueRouterPush.call(this, to).catch(err => err)
}



export default router







